package com.hucsmn.phone;

/**
 * 手机卡测试类。
 */
public class CardTest extends Tester {
    public static void main(String[] args) {
        Card card = new Card(CardKind.BIG, 10086, "YD", "passwd", 50.0, 0.0, 0L);

        asserts(card.getKind() == CardKind.BIG);
        asserts(card.getPhoneCode() == 10086);
        asserts(card.getUserName().equals("YD"));
        asserts(card.getPassWord().equals("passwd"));
        asserts(card.getBalance() == 50.0);
        asserts(card.getDuration() == 0.0);
        asserts(card.getTraffic() == 0L);

        card.setKind(CardKind.MICRO);
        card.setPhoneCode(10010);
        card.setUserName("LT");
        card.setPassWord("crypted");
        card.setBalance(100.0);
        card.setDuration(2.0);
        card.setTraffic(1024L);

        asserts(card.getKind() == CardKind.MICRO);
        asserts(card.getPhoneCode() == 10010);
        asserts(card.getUserName().equals("LT"));
        asserts(card.getPassWord().equals("crypted"));
        asserts(card.getBalance() == 100.0);
        asserts(card.getDuration() == 2.0);
        asserts(card.getTraffic() == 1024L);
    }
}
